public class MyBatisTest {
    @Test
    public void test_selectAllUser() throws Exception{
        //1、创建SqlSessionFactory对象，也是单例模式的
        SqlSessionFactory factory = MyBatisUitl.getSqlSessionFactory();
        //2、创建SqlSession对象
        SqlSession session = factory.openSession();
        //3、调用session的方法namespace的名字.id
        List<User> users = session.selectList("user.selectAllUser");
        //4、打印测试
        for(User u:users){
            System.out.println(u);
        }
        //5、关闭资源
        session.close();

    }
}